/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.qdu.servlet;

import com.qdu.entity.PublicActivity;
import com.qdu.service.AdminService;
import com.qdu.service.impl.PublicActivityServiceImpl;
import java.io.IOException;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.qdu.service.PublicActivityService;
import com.qdu.service.impl.AdminServiceImpl;

/**
 *
 * @author Daniel
 */
@WebServlet("/dapas")
public class DisplayAllPublicActivityServlet extends HttpServlet {
    PublicActivityService ps = new PublicActivityServiceImpl();
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

        
        req.setCharacterEncoding("utf-8");
        
        List<PublicActivity> list =  ps.displayAllPublic(); 
        req.setAttribute("activityList", list);
        req.getRequestDispatcher("/managePublicActivity.jsp").forward(req, resp);
    }
}

